<template>
  <div class="opinions">
    <div class="opinions_left">
      <div class="img">
        <img src="../../assets/image/opinions.png" alt="">
      </div>
      <div class="name">{{data.name}}</div>
    </div>
    <div class="opinions_right">
      {{data.comment}}
    </div>
  </div>
</template>

<script>
  export default {
    name: 'Opinion',
    props:['dataSource'],
    computed:{
        data(){
            let data = {}
            if(!this.dataSource || this.dataSource.length===0){
                return data
            }
            let rejects = this.dataSource.filter(value => {return value.taskFlow==='0'})
            if(!rejects || rejects.length===0){
                return data
            }
            return rejects[rejects.length-1]
        }
    }
  }
</script>

<style lang="less" scoped>
  .opinions {
    width: 100%;
    line-height: 28px;
    padding: 10px 30px 2px;
    background: #FEF6F0;
    box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.05);
    border-radius: 5px;
    margin-bottom: 15px;
    /*display: flex;*/
    /*justify-content: flex-start;*/
    /*align-items: flex-start;*/

    .opinions_left {
      display: inline-flex;
      justify-content: flex-start;
      align-items: center;
      /*min-width: 200px;*/

      .img {
        width: 36px;
        height: 28px;

        img {
          width: 100%;
          height: 100%;
          object-fit: cover;
          display: block;
        }
      }
      .name {
        height: 22px;
        line-height: 22px;
        font-size: 16px;
        color: #FFFFFF;
        background-color: #F48E3F;
        padding: 0 10px;
      }
    }
    .opinions_right {
      font-size: 14px;
      color: #DB7D4D;
      display: inline;
      vertical-align: super;
      margin-left: 14px;
    }
  }
</style>